<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>发布贴子</title>
<!-- 新 Bootstrap 核心 CSS 文件 -->
  <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

  <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

  <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
  <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <style>
  	.publishTies{
  		width:500px;
  		height:650px;
  		margin-left:500px;
  		margin-top:20px;
  		border:1px solid #000000;
  		border-radius:50px;
  		box-shadow:10px 10px 5px #000000;
  		background-image:url("./images/register2.jpg");
  		background-repeat:no-repeat;
  		background-size:cover;
  		background-color:rgba(0,0,0,0.5);
  	}
  	.panel{
  		background-color:rgba(0,0,0,0.2);
  	}
  	body{
  		background-image:url("./images/publishTies.jpg");
  		background-repeat:no-repeat;
  		background-size:cover;
  	}
  </style>
  <script>
  	 function check(){
  		 var tieTitle = document.myform.tieTitle.value;
  		 var tieCont = document.myform.tieCont.value;
  		 if(tieTitle=="" || tieCont==""){
  			 window.alert("帖子的标题或者帖子的内容不能为空");
  			 return false;
  		 }else{
  			 document.getElementByName("myform").submit();
  		 }
  	 }
  </script>
</head>
<body>
	<div class="page-header">
    <h1 style="color:#0099FF">发布贴子
        <small><a href='main.jsp'>点击返回首页</a></small>
    </h1>
    </div>
    <form class="bs-example bs-example-form" role="form" name="myform" method="post" action="publishTieServlet">
    <div class="publishTies">
    	<div class="panel panel-info" style="height:600px;width:400px;margin-left:50px;margin-top:20px;">
   			 <div class="panel-heading">
        			<h3 class="panel-title" style="margin-left:100px;">帖子标题</h3>
        			<div class="input-group" style="margin-left:50px;">
           			 	<input type="text" class="form-control" placeholder="请输入标题" name="tieTitle">
           			 	<button type="submit" class="btn btn-primary" onclick="return check()">发布</button>
        			</div>
    		</div>
    		<div class="panel-body" style="height:500px;">
      			 <textarea cols="50" rows="50" name="tieCont" style="height:500px;background-color:rgba(0,0,0,0.2);color:#0099FF"></textarea> 
    		</div>
		</div>	
    </div>
	</form>
</body>
</html>